<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>功能管理</a></li>
            <li class="active"><strong>兑奖活动管理</strong></li>
        </ol>
    </div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-app
     ng-controller="redemptionActivityCtrl">
    <form class="form-horizontal" id="form1" name="horizontal">
        <div class="row">
            <div class="col-lg-12" style="padding-bottom: 80px;">
                <div class="panel-body ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>兑奖活动管理</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">编号：</label>
                            <div class="col-sm-2">
                                <input type="text" style="width: auto" class="form-control" ng-model="info.excCode">
                            </div>
                            <label class="col-sm-2 control-label">状态：</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="info.status" ng-options="x.value as x.text for x in statuses"/>
                            </div>
                            <label class="col-sm-2 control-label">类型：</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="info.awardType" ng-options="x.value as x.text for x in awardTypes"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">有效期：</label>
                            <div class="col-sm-5">
                                <input id="d5231" class="form-control" type="datetime" ng-model="info.startTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5232.focus();},maxDate:'#F{$dp.$D(\'d5232\')}'})"/>
                                ~
                                <input id="d5232" class="form-control" type="datetime"  ng-model="info.endTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">使用时间：</label>
                            <div class="col-sm-5">
                                <input id="d5666" class="form-control" type="datetime" ng-model="info.awardStartTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5667=$dp.$('d5667');WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5667.focus();},maxDate:'#F{$dp.$D(\'d5667\')||\'%y-%M-%d\'}'})"/>
                                ~
                                <input id="d5667" class="form-control" type="datetime"  ng-model="info.awardEndTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5666\')}',maxDate:'%y-%M-%d 23:59:59'})"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">生成日期：</label>
                            <div class="col-sm-5">
                                <input id="d5668" class="form-control" type="datetime" ng-model="info.createStartTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5667=$dp.$('d5669');WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5669.focus();},maxDate:'#F{$dp.$D(\'d5669\')||\'%y-%M-%d\'}'})"/>
                                ~
                                <input id="d5669" class="form-control" type="datetime"  ng-model="info.createEndTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5668\')}',maxDate:'%y-%M-%d 23:59:59'})"/>
                            </div>
                        </div>
                        <div class="form-group" style="margin-bottom: -10px;">
                            <div class="col-sm-2"> </div>
                            <div class="col-sm-10">
                                <button class="btn btn-primary3 btn-rounded btn-mr20" type="button" ng-click="clear()">清空</button>
                                <button class="btn btn-primary6 btn-rounded btn-mr20" type="button" ng-click="query()">查询</button>
                                <a class="btn btn-new2 btn-mr20" type="button" ng-show="hasPermit('redemption.redemptionActivityManage')" target="_blank" ui-sref="func.redemptionActivityManage">奖券类型管理</a>
                                <button class="btn btn-new2 btn-mr20" type="button" ng-show="hasPermit('redemption.addRedemptionActivity')" ng-click="addButchModel()">新增兑奖码</button>
                                <button class="btn btn-new btn-mr20" type="button" ng-show="hasPermit('redemption.exportRedemptionActivity')" ng-click="export()">导出</button>
                            </div>
                        </div>
                        <div class="panel-body ibox float-e-margins">
                            <div class="ibox-content">
                                <div class="gridStyle" ui-grid="servicesGrid" ui-grid-selection ui-grid-pinning ui-grid-pagination ui-grid-resize-columns></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-4">
                                <a type="button" class="btn btn-primary4"
                                   ui-sref="func.couponActivity">返回</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div id="addButchModel" class="modal fade" tabindex="3"
         role="dialog">
        <form class="form-horizontal" id="form4">
            <div class="modal-dialog" style="height: 400px; width: 700px">
                <div class="modal-content" style="height: 400px; width: 700px">
                    <div class="ibox-title">
                        <button type="button" class="close" data-dismiss="modal">×</button>
                        <h5>新增兑奖码</h5>
                    </div>
                    <div class="modal-body">
                        <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">生成兑奖券数量：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="infoAdd.num">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">奖券名称：</label>
                                <div class="col-sm-3">
                                    <select class="form-control" ng-model="infoAdd.awardsConfigId" ng-options="x.value as x.text for x in redemptionList">
                                        <option value="" selected>请选择</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">有效期：</label>
                                <div class="col-sm-8" style="float:left">
                                    <div style="float:left; padding:7px 10px 0 10px">从获得当天算起</div>
                                    <input type="text" class="form-control" style="float:left; width:100px" ng-model="infoAdd.day">
                                    <div style="float:left; padding:7px 0 0 10px">天内使用有效</div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group control-label">
                            <div class="col-sm-8">
                                <button class="btn btn-primary btn-mr20" type="button" ng-click='addRedemption()'>确定</button>
                                <button class="btn btn-primary8 " type="button" ng-click='cancelAddButchModel()'>取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>